﻿using LitTools;

public partial class BattleManager : Singleton<BattleManager>, ISingleton
{
    int ISingleton.Order => 100;

    private StateMechine stateMechine;
    private BattleState_Prepare prepareState;
    private BattleState_Play playState;
    private BattleState_Pause pauseState;
    private BattleState_Finish finishState;

    void ISingleton.OnInit()
    {
        stateMechine = new StateMechine();
        prepareState = new BattleState_Prepare();
        playState = new BattleState_Play();
        pauseState = new BattleState_Pause();
        finishState = new BattleState_Finish();
        stateMechine.AddState(prepareState);
        stateMechine.AddState(playState);
        stateMechine.AddState(pauseState);
        stateMechine.AddState(finishState);
    }
    void ISingleton.OnUpdate()
    {
        stateMechine.Update();
    }
    void ISingleton.OnDestroy()
    {
        stateMechine.Stop();
    }

}
